package com.jlpay.openapi.demo.openmerch.change;

import com.jlpay.open.jlpay.sdk.java.model.openmerch.change.request.FixedWithdrawModifyRequest;
import com.jlpay.open.jlpay.sdk.java.model.openmerch.change.response.FixedWithdrawModifyResponse;
import com.jlpay.open.jlpay.sdk.java.utils.json.JsonUtils;
import com.jlpay.openapi.demo.JlpayOpenApiService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Arrays;

/**
 * 商户定点清算修改
 *
 * @author zhangyongfeng
 * @date 2025/8/1
 */
public class FixedWithdrawModifyService {
    private static final Logger LOGGER = LoggerFactory.getLogger(FixedWithdrawModifyService.class);

    public static void main(String[] args) {
        FixedWithdrawModifyRequest request = buildRequest();
        FixedWithdrawModifyResponse response = JlpayOpenApiService.openMerchWithCryptoService()
                .post(request, FixedWithdrawModifyResponse.class);
        LOGGER.info("商户定点清算修改响应:{}", JsonUtils.toString(response));
    }

    private static FixedWithdrawModifyRequest buildRequest() {
        FixedWithdrawModifyRequest request = new FixedWithdrawModifyRequest();
        request.setApplyId("b8659ea518d14c99b78b5ad000a4155C");
        // 商户号
        request.setMerchNo("849584358140108");
        request.setOperateType("1");
        request.setWithdrawTimeList(Arrays.asList("180000"));
        return request;
    }
}
